package com.pet.cart.mapper;

import com.pet.cart.domain.po.Cart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 购物车表 Mapper 接口
 * </p>
 *
 * @author Cookies
 * @since 2024-07-11
 */
public interface CartMapper extends BaseMapper<Cart> {
    @Update("UPDATE cart SET number = number + #{quantity} WHERE user_id = #{userId} AND item_id = #{itemId}")
    boolean updateNum(@Param("itemId") Integer itemId, @Param("userId") Integer userId, @Param("quantity") Integer quantity);
}
